home *** CD-ROM | disk | FTP | other *** search
- From: bill@amber.ssd.hcsc.com (Bill Leonard)
- Message-ID: <4ictfr$r43@ns.hcsc.com>
- X-Original-Date: 15 Mar 1996 23:11:55 GMT
- Path: in2.uu.net!bounce-back
- Date: 16 Mar 96 10:15:46 GMT
- Approved: fjh@cs.mu.oz.au
- Newsgroups: comp.std.c++
- Subject: Re: String value of enum
- Organization: Harris Computer Systems, Ft. Lauderdale FL
- References: <4i5sf3$89c@hermes.is.co.za> <Do81tp.H9u@rsvl.unisys.com> <KANZE.96Mar14131235@gabi.gabi-soft.fr>
- Reply-To: Bill.Leonard@mail.hcsc.com
- X-Auth: PGPMoose V1.1 PGP comp.std.c++
- iQBFAgUBMUqU6eEDnX0m9pzZAQH7XQF/b4mgwGpyRAKsrSBKkUuedmAAvk6hAKn2
- qcRmZPi7MZ57rd53e8iIOHKqlZW/FdNa
- =QMZI
-
- In article <KANZE.96Mar14131235@gabi.gabi-soft.fr>, kanze@gabi-soft.fr
- (J. Kanze) writes:
-
- > Well, it is supported in other languages. But I agree that it will not
- > be in C++, and should not be there, for an entirely different reason.
- > What happens to such strings when you change locale? (In practice, they
- > are only good for debugging because of this. And any decent debugger
- > will be able to display the information without the table in the
- > compiler.)
-
- It is true that any decent debugger should be able to display it. But, I
- often write debug code in my programs (for instance, to display complicated
- data structures in an intelligent fashion) that a debugger *cannot* display
- as well because it doesn't know the details of the structures.
- Furthermore, there are often times when the debug code gets executed
- without a debugger being used.
-
- In fact, our debugger even has a mechanism that allows you to load
- additional object code into a running program, partly so that you can write
- custom debug functions like this and call them from the debugger!
-
- But I disagree with the statement that "these are only good for debugging
- because [they cannot be internationalized]". As a case in point, consider
- a C++ compiler that had an enum for all the C++ keywords. Will those
- keywords change when the compiler is internationalized? No. Wouldn't it
- be nice if the enum names could be automatically turned into strings for
- things like error messages? (Okay, you might have to massage the strings
- because the enum values are not spelled exactly like the keywords, but you
- might use enum values like KWD_const, KWD_namespace, etc.)
-
- Programs that have a command language (like a debugger perhaps?) also
- frequently have enums for all the commands they accept. Again, the
- spelling is not usually affected by internationalization, and it is common
- to translate between enum value and the string version.
-
- > What happens to such strings when you change locale?
-
- Why is this a problem? I wouldn't expect *anything* to happen to them.
-
- > Now this is going to be really fun to maintain.
-
- Exactly why it would be better for this to be built into the language.
-
- > What happens when the
- > program is prepared for internationalization, and the translater
- > modifies the strings?
-
- If it were built into the language, he wouldn't do that, would he? :-)
-
- --
- Bill Leonard
- Harris Computer Systems Corporation
- 2101 W. Cypress Creek Road
- Fort Lauderdale, FL 33309
- Bill.Leonard@mail.hcsc.com
-
- These opinions and statements are my own and do not necessarily reflect the
- opinions or positions of Harris Computer Systems Corporation.
-
- ------------------------------------------------------------------------------
- There's something wrong with an industry in which amazement is a common
- reaction to things going right.
-
- "Hard work never scared me. Oh, sure, it has startled me from a distance."
- -- Professor Fishhawk
- ------------------------------------------------------------------------------
- ---
- [ comp.std.c++ is moderated. To submit articles: try just posting with ]
- [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
- [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
- [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
- [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
-